load("@fbcode_macros//build_defs:thrift_library.bzl", "thrift_library")
load("//common/automock:automock.bzl", "thrift_plugin_automock")

oncall("scm_server_infra")

thrift_library(
    name = "source_control",
    java_versions = [
        "21",
    ],
    languages = [
        "hs2",
        "rust",
        "py3-deprecated",
        "cpp2",
        "java-swift",
        "py-deprecated",
        "python",
    ],
    plugins = [
        thrift_plugin_automock,
    ],
    py3_namespace = "scm.service.thrift",
    py_base_module = "scm.service.thrift",
    rust_deps = [
        "fbsource//third-party/rust:bytes",
        "fbsource//third-party/rust:faster-hex",
        "fbsource//third-party/rust:smallvec",
    ],
    rust_extra_srcs = [
        "extra_thrift.rs",
    ],
    rust_include_srcs = [
        "include_thrift.rs",
    ],
    thrift_cpp2_options = [
        "reflection",
    ],
    thrift_py_options = "utf8strings",
    thrift_rust_options = [
        "deprecated_default_enum_min_i32",
        "serde",
    ],
    thrift_srcs = {
        "source_control.thrift": ["SourceControlService"],
    },
    deps = [
        "//eden/mononoke/derived_data/if:derived_data_type_if",
        "//eden/mononoke/megarepo_api/if:megarepo_configs",
        "//fb303/thrift:fb303_core",
        "//thrift/annotation:hack",
        "//thrift/annotation:rust",
        "//thrift/annotation:thrift",
    ],
)
